/**
 * @author : cww
 * @date : 2020/12/26 22:35
 * 双重判断，可以保证多线程安全，只有第一次创建时才会进行加销
 * 线程安全：是
 * 是否延迟加载：是
 * 推荐：是
 */
public final class InstanceDoubleCheck {
    private static InstanceDoubleCheck instanceDoubleCheck;
    private InstanceDoubleCheck(){}
    public static InstanceDoubleCheck getInstance(){
        if(instanceDoubleCheck==null){
            synchronized (instanceDoubleCheck){
                if(instanceDoubleCheck==null){
                    instanceDoubleCheck = new InstanceDoubleCheck();
                }
            }
        }
        return instanceDoubleCheck;
    }
}
